﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace homework1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            //Console.WriteLine("你好！我是吴旭");
            //Console.ReadKey();
            int High=int.Parse(Console.ReadLine());
            int Low=int.Parse(Console.ReadLine());
            List<int> list = new List<int>();
            for (int i = Low; i <= High; i++) { 
                if(isPrime(i))
                    list.Add(i);
            }
            for (int i = 0; i < list.Count;) {
                Console.Write(list[i] + " ");
                i++;
                if(i%10==0)
                    Console.WriteLine();
            }
            Console.ReadKey();
        }

        private static bool isPrime(int x) {
            if (x == 1)
                return false;
            for (int i = 2; i <= x / 2; i++)
            {
                if (x % i == 0)
                    return false;
            }
            return true;
        }
    }
}
